app.service('channelUserService',function ($http) {

    this.findPage = function (pageNum,pageSize,searchEntity) {
      return $http.post("../channelUser/findPage?pageNum=" + pageNum + "&pageSize=" + pageSize,searchEntity)
    };

    this.insert = function (channelUser) {
        return $http.post("../channelUser/insert",channelUser);
    };

    this.update = function (channelUser) {
        return $http.post("../channelUser/update",channelUser);
    };

    this.findOne = function (channelUserId) {
        return $http.get("../channelUser/findOne?channelUserId=" + channelUserId);
    };

    this.findChannelUserNames = function (channelUserId) {

        if (channelUserId == null){
            return $http.get("../channelUser/findChannelUserNames");
        } else {
            return $http.get("../channelUser/findChannelUserNames?channelUserId=" + channelUserId);
        }

    };

});